# Contributor: omni <omni+alpine@hack.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=sysfsutils
pkgver=2.1.1
pkgrel=3
pkgdesc="System Utilities Based on Sysfs"
url="https://github.com/linux-ras/sysfsutils"
arch="all"
makedepends="autoconf automake libtool"
options="!check" # FIXME: A test suite exist but need to be configured
license="GPL-2.0-only AND LGPL-2.1-only"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/linux-ras/sysfsutils/archive/v$pkgver.tar.gz"

prepare() {
	default_prepare
	./autogen
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm0644 COPYING -t "$pkgdir"/usr/share/licenses/"$pkgname"
}

sha512sums="7e1c8535be3c29dec8e23e8b6e8d3ec794bbdc696f161fa38731844c82cc1d37ff04f94c8b0ec0cf8da7147fc696dad0086262641984fa67378ffd2f162dc358  sysfsutils-2.1.1.tar.gz"
